<template>
	<mt-swipe :auto="5000">
      <mt-swipe-item v-for='(item,index) in list' :key='index'>
        <div class="banner-img" @click='goUrl(item.url)'>
            <img :src="item.image"/>
        </div>
      </mt-swipe-item>
  </mt-swipe>
</template>
<script>
import { Swipe, SwipeItem } from "mint-ui";
import {banner } from '@/request/api'
	export default{
		data(){
			return{
				mtSwipe: Swipe,
    		mtSwipeItem: SwipeItem,
        list:[],
			}
		},
		methods:{
      getBanner(){
        banner().then(v=>{
          this.list = v;
        })
      },
      goUrl(url){
        window.location.href = url;
      }
    },
    created(){
      this.getBanner()
    },
    mounted(){

    }
	};
</script>
<style lang="less" scoped>
	.banner-img{
		img{
			width: 100%;
			height: 1.2rem;
		}
	}
</style>